import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-10-12
 * Time:20:19
 */

public class Tangent {
    public static List<List<Integer>> generate(int number){
        List<List <Integer>> LIST=new ArrayList<>();
        //list代表的是一行
        for (int i = 0; i < number; i++) {
            List<Integer> list=new ArrayList<>();
            //第一行和第二行是增加1
            if(i<2){
                for (int j = 0; j < i+1; j++) {
                    list.add(1);
                }
            }else {
                //以后的行数
                list.add(1);
                for (int j = 1; j < i; j++) {
                    list.add(LIST.get(i-1).get(j)+LIST.get(i-1).get(j-1));
                }
                list.add(1);
            }

            LIST.add(list);
        }
        //LIST都加一次list
        return LIST;
    }

    public static void main(String[] args) {
        System.out.println(generate(7));
    }
}
